<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body>
<?php
require_once './../class/MonthlyReport.inc';

$mem_id = $_POST ['mem_id'];
$name = $_POST ['name'];
$cusm_cd = $_POST ['cusm_cd'];
$c_brno = $_POST ['c_brno'];
$car_id = $_POST ['car_id'];
$bank_nm = $_POST ['bank_nm'];
$act_nm = $_POST ['act_nm'];
$actno = $_POST ['actno'];

$account_fee            = str_replace(",","", $_POST ['account_fee']);
$acct_fee               = str_replace(",","", $_POST ['acct_fee']);
$ada_pay                = str_replace(",","", $_POST ['ada_pay']);
$apd_dil_exp            = str_replace(",","", $_POST ['apd_dil_exp']);
$attend_exp             = str_replace(",","", $_POST ['attend_exp']);
$car_tax                = str_replace(",","", $_POST ['car_tax']);
$car_wash_exp           = str_replace(",","", $_POST ['car_wash_exp']);
$charoff_etc_fee        = str_replace(",","", $_POST ['charoff_etc_fee']);
$comm_exp               = str_replace(",","", $_POST ['comm_exp']);
$commit_fee             = str_replace(",","", $_POST ['commit_fee']);
$commute_oil_fee        = str_replace(",","", $_POST ['commute_oil_fee']);
$dayoff_dedt            = str_replace(",","", $_POST ['dayoff_dedt']);
$deposit                = str_replace(",","", $_POST ['deposit']);
$dil_etc_exp            = str_replace(",","", $_POST ['dil_etc_exp']);
$dil_van_exp            = str_replace(",","", $_POST ['dil_van_exp']);
$early_slot             = str_replace(",","", $_POST ['early_slot']);
$ex_incen_pay           = str_replace(",","", $_POST ['ex_incen_pay']);
$fare_amt               = str_replace(",","", $_POST ['fare_amt']);
$fine_fee               = str_replace(",","", $_POST ['fine_fee']);
$gps_fee                = str_replace(",","", $_POST ['gps_fee']);
$incen_pay              = str_replace(",","", $_POST ['incen_pay']);
$incm_tax               = str_replace(",","", $_POST ['incm_tax']);
$instl_deg              = str_replace(",","", $_POST ['instl_deg']);
$instl_fee              = str_replace(",","", $_POST ['instl_fee']);
$insu_deg               = str_replace(",","", $_POST ['insu_deg']);
$insu_fee               = str_replace(",","", $_POST ['insu_fee']);
$mileage_fee            = str_replace(",","", $_POST ['mileage_fee']);
$mngt_exp               = str_replace(",","", $_POST ['mngt_exp']);
$oil_exp                = str_replace(",","", $_POST ['oil_exp']);
$paint_exp              = str_replace(",","", $_POST ['paint_exp']);
$per_incen_pay          = str_replace(",","", $_POST ['per_incen_pay']);
$receipt_exp            = str_replace(",","", $_POST ['receipt_exp']);
$sply_amt               = str_replace(",","", $_POST ['sply_amt']);
$surtax                 = str_replace(",","", $_POST ['surtax']);
$trans_fee              = str_replace(",","", $_POST ['trans_fee']);
$extension_pay          = str_replace(",","", $_POST ['extension_pay']);
$annual_pay             = str_replace(",","", $_POST ['annual_pay']);
$dispatcher_amt         = str_replace(",","", $_POST ['dispatcher_amt']);
$commit_pay             = str_replace(",","", $_POST ['commit_pay']);
$meal_pay               = str_replace(",","", $_POST ['meal_pay']);
$car_assist_amt         = str_replace(",","", $_POST ['car_assist_amt']);
$etc_pay                = str_replace(",","", $_POST ['etc_pay']);
$etc_amt                = str_replace(",","", $_POST ['etc_amt']);
$pension_fee            = str_replace(",","", $_POST ['pension_fee']);
$insurance_fee          = str_replace(",","", $_POST ['insurance_fee']);
$recuperation_fee       = str_replace(",","", $_POST ['recuperation_fee']);
$unemploy_insurance_fee = str_replace(",","", $_POST ['unemploy_insurance_fee']);
$income_tax             = str_replace(",","", $_POST ['income_tax']);
$city_tax               = str_replace(",","", $_POST ['city_tax']);
$prepay_amt             = str_replace(",","", $_POST ['prepay_amt']);
$etc_deduct_amt         = str_replace(",","", $_POST ['etc_deduct_amt']);
$attend_deduct_amt      = str_replace(",","", $_POST ['attend_deduct_amt']);
$month_notice           = str_replace(",","", $_POST ['month_notice']);

$monthlyReport = new MonthlyReport ();

if ($_POST ['sb_bt'] == '1') {
	// 임시저장
	$monthlyReport->modifyMonthlyReport ( '1'                    , $mem_id       , $account_fee  , $acct_fee       , $ada_pay       , $apd_dil_exp
										, $attend_exp            , $car_tax      , $car_wash_exp , $charoff_etc_fee, $comm_exp      , $commit_fee
										, $commute_oil_fee       , $dayoff_dedt  , $deposit      , $dil_etc_exp    , $dil_van_exp   , $early_slot
										, $ex_incen_pay          , $fare_amt     , $fine_fee     , $gps_fee        , $incen_pay     , $incm_tax
										, $instl_deg             , $instl_fee    , $insu_deg     , $insu_fee       , $mileage_fee   , $mngt_exp
										, $oil_exp               , $paint_exp    , $per_incen_pay, $receipt_exp    , $sply_amt      , $surtax
										, $trans_fee             , $extension_pay, $annual_pay   , $dispatcher_amt , $commit_pay    , $meal_pay
										, $car_assist_amt        , $etc_pay      , $etc_amt      , $pension_fee    , $insurance_fee , $recuperation_fee
										, $unemploy_insurance_fee, $income_tax   , $city_tax     , $prepay_amt     , $etc_deduct_amt, $attend_deduct_amt
										, $month_notice );
} else if ($_POST ['sb_bt'] == '2') {
	// 결산완료
	$monthlyReport->modifyMonthlyReport ( '2'                    , $mem_id       , $account_fee  , $acct_fee       , $ada_pay       , $apd_dil_exp
										, $attend_exp            , $car_tax      , $car_wash_exp , $charoff_etc_fee, $comm_exp      , $commit_fee
										, $commute_oil_fee       , $dayoff_dedt  , $deposit      , $dil_etc_exp    , $dil_van_exp   , $early_slot
										, $ex_incen_pay          , $fare_amt     , $fine_fee     , $gps_fee        , $incen_pay     , $incm_tax
										, $instl_deg             , $instl_fee    , $insu_deg     , $insu_fee       , $mileage_fee   , $mngt_exp
										, $oil_exp               , $paint_exp    , $per_incen_pay, $receipt_exp    , $sply_amt      , $surtax
										, $trans_fee             , $extension_pay, $annual_pay   , $dispatcher_amt , $commit_pay    , $meal_pay
										, $car_assist_amt        , $etc_pay      , $etc_amt      , $pension_fee    , $insurance_fee , $recuperation_fee
										, $unemploy_insurance_fee, $income_tax   , $city_tax     , $prepay_amt     , $etc_deduct_amt, $attend_deduct_amt
										, $month_notice );
}

?>

<script type="text/javascript">
<?php
if ($_POST ['sb_bt'] == '1') {
	echo "alert('월 결산 임시저장이 완료되었습니다.');";
} else {
	echo "alert('월 결산이 완료되었습니다.');";
}
?>
history.back();
</script>
</body>
</html>